package io;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * 字符缓冲输入流测试
 */
public class BufferedReaderTest {
    public static void main(String[] args) {
        read();
    }

    private static void read() {
        try (BufferedReader br = new BufferedReader(new FileReader("/Users/luchuan/IdeaProjects/java-test/a.txt"))) {
            final char[] chars = new char[1024];
            int len;
            if ((len = br.read(chars)) != -1) {
                System.out.println(new String(chars, 0, len));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
